<script>
    let arr = [19,3,9,90,1,32,20]
    Array.prototype.insertSort = function () {
        for(let i = 1; i < this.length; i++){
            let temp = this[i];
            let j = i;
            while(j>0){
                console.log("-------------");
                console.log(this[j-1]);
                console.log(this[j]);
                console.log(temp);
                console.log(this);
                console.log("-------------");
                if(this[j-1]>temp){
                    this[j] = this[j-1]
                }else{
                    break;
                }
                j -= 1
            }
            this[j] = temp
        }
        
    }
    arr.insertSort()
    console.log(arr);
</script>